﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// 产品制程（产品对应的工艺路线）
/// </summary>
/// <remarks>同一个产品在同一条产线上只能有一种工艺路线</remarks>
[SugarTable("proc_routing_product", "产品制程表")]
public class ProcRoutingProduct : EntityBase
{
    /// <summary>
    /// 产品 Id
    /// </summary>
    [SugarColumn(ColumnDescription = "产品Id")]
    public long ProductId { get; set; }

    /// <summary>
    /// 产品信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ProductId))]
    public MdItem? Product { get; set; }

    /// <summary>
    /// 工艺路线 Id
    /// </summary>
    [SugarColumn(ColumnDescription = "工艺路线Id")]
    public long RoutingId { get; set; }

    /// <summary>
    /// 工艺路线
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(RoutingId))]
    public ProcRouting? Routing { get; set; }
}
